package com.ccrfid.rmc6.ws.example;

import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;

@Endpoint
public class ExampleEndpoint {
    private static final String NAMESPACE_URI = "http://helloworld.com/example";

    @PayloadRoot(namespace = NAMESPACE_URI, localPart = "helloRequest")
    @ResponsePayload
    public ExampleResponse helloStudent(@RequestPayload ExampleRequest request) {
        System.out.println("ExampleRequest studentId: " + request.getStudentId());
        ExampleResponse student = new ExampleResponse(request.getStudentId(), "zhrq", 31, "room 7");
        return student;
    }

}
